$(function(){
	$('.input-text input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#zd_login").validate({
		rules:{
			login_phone:{
				required:true,
				minlength:2,
				maxlength:16
			},
			password:{
				required:true,
				minlength:6,
				maxlength:16
			},
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$("#zd_login").ajaxSubmit({
					type: 'post',
		           	dataType:'text',
		            url: "/p.php?m=zb&c=login&a=login_check",
		            data: {
		            },
		            success: function(data) {
						if(data==1){
		                	layer.msg('用户名或密码错误!',{icon: 5,time:1000});
		                }else if(data==2){
		                	layer.msg('帐号被禁用!',{icon: 5,time:1000});		                	
		                }else if(data==3){
		                	layer.msg('帐号未审核!',{icon: 5,time:1000});		                	
		                }else{
		                	window.location.href="/p.php?m=zb&c=login&a=login_pass";
		                }
		            }
			});
			return false;
		}
	});
});